Skip to content

Extract UI components into shared @repo/shadcn package and add Base UI wrappers#111

Open
naymurdev wants to merge 2 commits into
mainfrom
codex/integrate-and-configure-radix-and-base-ui
Open

Extract UI components into shared @repo/shadcn package and add Base UI wrappers#111
naymurdev wants to merge 2 commits into
mainfrom
codex/integrate-and-configure-radix-and-base-ui

Conversation

@naymurdev

@naymurdev naymurdev commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Centralize shared UI components into a single package to avoid duplication across apps and enable consistent API surface.
  • Provide "Base UI" adapter layers to allow swapping or shimming underlying implementations while keeping the existing shadcn API.
  • Replace a local button implementation with a canonical re-export to simplify maintenance and dependency management.

Description

  • Replaced the local apps/ui-layout/components/website/ui/button.tsx implementation with export { Button, buttonVariants } from '@repo/shadcn' and export type { ButtonProps } from '@repo/shadcn' to consume the shared package.
  • Updated apps/ui-layout/package.json to add new dependencies including @base-ui-components/react, @radix-ui/react-accordion, @radix-ui/react-collapsible, and @radix-ui/react-separator to support the new shared components.
  • Extended packages/shadcn/package.json dependencies to include @base-ui-components/react and several @radix-ui packages and kept tailwind-merge and other existing deps.
  • Added a collection of packages/shadcn/src/base-ui/* placeholder adapter modules that re-export existing ui components or adapt @base-ui-components/react (notably an adapter accordion.tsx with a BaseUiAccordion export).
  • Added a new packages/shadcn/src/ui/accordion.tsx implementation and updated packages/shadcn/src/index.tsx and packages/shadcn/src/ui/index.tsx to export the new accordion and the base-ui index.

Testing

  • No automated tests were run as part of this change.

Codex Task

Summary by CodeRabbit

  • New Features

    • Added many UI components: Accordion, Alert, Checkbox, Separator, Skeleton, Textarea, DatePicker (alias), Sheet, Combobox and other interactive primitives.
    • Exposed additional base UI variants to standardize component availability.
  • Refactor

    • Button consolidated to a shared library re-export for consistent behavior and styling across apps.

Review Change Stack

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
uilayouts-ui-layout Error Error May 24, 2026 9:42pm

Request Review

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 201cf850-7ed3-4bc9-b05c-26b7d0a34ce1

📥 Commits

Reviewing files that changed from the base of the PR and between 202b4c7 and 49badcd.

📒 Files selected for processing (39)
  • packages/shadcn/package.json
  • packages/shadcn/src/base-ui/alert-dialog.tsx
  • packages/shadcn/src/base-ui/alert.tsx
  • packages/shadcn/src/base-ui/checkbox.tsx
  • packages/shadcn/src/base-ui/collapsible.tsx
  • packages/shadcn/src/base-ui/combobox.tsx
  • packages/shadcn/src/base-ui/context-menu.tsx
  • packages/shadcn/src/base-ui/date-picker.tsx
  • packages/shadcn/src/base-ui/index.tsx
  • packages/shadcn/src/base-ui/menubar.tsx
  • packages/shadcn/src/base-ui/progress.tsx
  • packages/shadcn/src/base-ui/radio-group.tsx
  • packages/shadcn/src/base-ui/select.tsx
  • packages/shadcn/src/base-ui/separator.tsx
  • packages/shadcn/src/base-ui/sheet.tsx
  • packages/shadcn/src/base-ui/skeleton.tsx
  • packages/shadcn/src/base-ui/sonner.tsx
  • packages/shadcn/src/base-ui/textarea.tsx
  • packages/shadcn/src/base-ui/toggle-group.tsx
  • packages/shadcn/src/base-ui/toggle.tsx
  • packages/shadcn/src/ui/alert-dialog.tsx
  • packages/shadcn/src/ui/alert.tsx
  • packages/shadcn/src/ui/checkbox.tsx
  • packages/shadcn/src/ui/collapsible.tsx
  • packages/shadcn/src/ui/combobox.tsx
  • packages/shadcn/src/ui/context-menu.tsx
  • packages/shadcn/src/ui/date-picker.tsx
  • packages/shadcn/src/ui/index.tsx
  • packages/shadcn/src/ui/menubar.tsx
  • packages/shadcn/src/ui/progress.tsx
  • packages/shadcn/src/ui/radio-group.tsx
  • packages/shadcn/src/ui/select.tsx
  • packages/shadcn/src/ui/separator.tsx
  • packages/shadcn/src/ui/sheet.tsx
  • packages/shadcn/src/ui/skeleton.tsx
  • packages/shadcn/src/ui/sonner.tsx
  • packages/shadcn/src/ui/textarea.tsx
  • packages/shadcn/src/ui/toggle-group.tsx
  • packages/shadcn/src/ui/toggle.tsx
✅ Files skipped from review due to trivial changes (19)
  • packages/shadcn/src/base-ui/toggle.tsx
  • packages/shadcn/src/ui/sonner.tsx
  • packages/shadcn/src/base-ui/toggle-group.tsx
  • packages/shadcn/src/base-ui/skeleton.tsx
  • packages/shadcn/src/ui/toggle.tsx
  • packages/shadcn/src/ui/select.tsx
  • packages/shadcn/src/base-ui/combobox.tsx
  • packages/shadcn/src/base-ui/menubar.tsx
  • packages/shadcn/src/ui/combobox.tsx
  • packages/shadcn/src/base-ui/separator.tsx
  • packages/shadcn/src/ui/alert-dialog.tsx
  • packages/shadcn/src/base-ui/context-menu.tsx
  • packages/shadcn/src/base-ui/progress.tsx
  • packages/shadcn/src/base-ui/alert.tsx
  • packages/shadcn/src/base-ui/date-picker.tsx
  • packages/shadcn/src/base-ui/alert-dialog.tsx
  • packages/shadcn/src/base-ui/select.tsx
  • packages/shadcn/src/ui/radio-group.tsx
  • packages/shadcn/src/ui/alert.tsx

📝 Walkthrough

Walkthrough

Adds a Radix-based Accordion and Base UI wrapper; creates many base-ui re-export shim modules and new ui/* entrypoints; updates package dependencies; and replaces the local Button with re-exports from @repo/shadcn.

Changes

Component Library Expansion: Accordion and Base UI Integration

Layer / File(s) Summary
Dependency setup and package configuration
apps/ui-layout/package.json, packages/shadcn/package.json
Add @base-ui-components/react and several @radix-ui/react-* packages to project dependencies.
Radix Accordion UI implementation
packages/shadcn/src/ui/accordion.tsx
Add Accordion, AccordionItem, AccordionTrigger, AccordionContent wrappers built on Radix primitives with forwardRef, class merging, chevron rotation, and data-state-driven animations.
Base UI Accordion wrapper component
packages/shadcn/src/base-ui/accordion.tsx
Wrap @base-ui-components/react/accordion primitives and export BaseUiAccordion object with Root, Item, Trigger, Content wrappers.
Base UI re-export parity modules
packages/shadcn/src/base-ui/*, packages/shadcn/src/base-ui/index.tsx
Add many base-ui placeholder modules that re-export corresponding ../ui/* implementations to maintain API parity and expand the base-ui barrel.
UI entrypoints and new components
packages/shadcn/src/ui/*, packages/shadcn/src/ui/index.tsx
Add or update ui entrypoints (alert, alert-dialog, checkbox, collapsible, combobox, context-menu, date-picker, menubar, progress, radio-group, select, separator, sheet, skeleton, sonner, textarea, toggle, toggle-group) and update UI barrel exports.
Button re-export consolidation
apps/ui-layout/components/website/ui/button.tsx
Replace local Button implementation with re-exports of Button, buttonVariants, and ButtonProps from @repo/shadcn.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

🐰 I hopped through exports, stitched base-ui and chevrons bright,

Buttons now borrowed, accordions take flight.
Re-exports like carrots, lined up in a row,
A tidy little garden where components can grow. 🎋

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: extracting UI components into a shared package and adding Base UI adapter wrappers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/integrate-and-configure-radix-and-base-ui
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch codex/integrate-and-configure-radix-and-base-ui

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/shadcn/src/base-ui/alert-dialog.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/shadcn/src/base-ui/alert.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

packages/shadcn/src/base-ui/checkbox.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 35 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 202b4c7eff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Button.displayName = 'Button';

export { Button, buttonVariants };
export { Button, buttonVariants } from '@repo/shadcn'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the local uilayouts button variant

Re-exporting the shared package button drops the app-specific uilayouts variant that this file used to define. The website still renders <Button variant='uilayouts'> in apps/ui-layout/components/website/copy-page.tsx lines 82 and 136, and the shared packages/shadcn/src/ui/button.tsx variant map has no uilayouts entry, so those copy-page controls lose their intended dark/light border styling at runtime rather than behaving like the previous local button.

Useful? React with 👍 / 👎.

Comment on lines +81 to +84
"@base-ui-components/react": "^1.0.0-beta.3",
"@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-collapsible": "^1.1.4",
"@radix-ui/react-separator": "^1.1.4"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the Bun lockfile with the new dependencies

These newly added packages are not represented anywhere in the committed bun.lock (I checked with rg for @base-ui-components/react, @radix-ui/react-accordion, @radix-ui/react-collapsible, and @radix-ui/react-separator). In environments that install with bun install --frozen-lockfile—whose help says it disallows lockfile changes—the install cannot materialize the new dependencies required by the new accordion import, so the lockfile needs to be regenerated and committed with the package.json changes.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/shadcn/package.json (1)

25-25: ⚡ Quick win

Pin beta dependency to an exact version.

^1.0.0-beta.3 allows upgrades to any stable 1.x release (e.g., 1.0.0, 1.1.0), risking unexpected API drift in this foundational package. Pin to an exact version until Base UI reaches stable 2.0.0.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shadcn/package.json` at line 25, The dependency entry
"`@base-ui-components/react`": "^1.0.0-beta.3" should be pinned to an exact
version to avoid accidental upgrades; update the package.json dependency for
`@base-ui-components/react` by removing the caret and using the exact version
string "1.0.0-beta.3" (so it reads "`@base-ui-components/react`": "1.0.0-beta.3"),
then run your package manager install to lock the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/shadcn/src/index.tsx`:
- Around line 3-4: The top-level exports in packages/shadcn/src/index.tsx are
causing duplicate exports: remove the explicit accordion re-export and eliminate
the conflicting base-ui barrel to avoid duplicate symbols (e.g.,
BaseUiAccordion, Button, Badge, Tooltip, Command, Popover); specifically delete
the line exporting './base-ui/accordion' and remove (or replace) the line
exporting './base-ui' so you only export the intended modules directly (or only
export the base-ui barrel), ensuring no duplicate re-exports of ui/button and
other identical identifiers.

In `@packages/shadcn/src/ui/accordion.tsx`:
- Around line 43-49: The consumer-facing className is being applied to the inner
wrapper instead of the content root; change the placement so
AccordionPrimitive.Content receives the merged classes (including
'overflow-hidden text-sm data-[state=closed]:animate-accordion-up
data-[state=open]:animate-accordion-down' and the incoming className via cn) and
remove className from the inner div that currently wraps children so that
consumers can override the content root; update the component that renders
AccordionPrimitive.Content (keeping ref, {...props}, children) to merge
cn(className, ...) onto AccordionPrimitive.Content instead of the inner <div>.

---

Nitpick comments:
In `@packages/shadcn/package.json`:
- Line 25: The dependency entry "`@base-ui-components/react`": "^1.0.0-beta.3"
should be pinned to an exact version to avoid accidental upgrades; update the
package.json dependency for `@base-ui-components/react` by removing the caret and
using the exact version string "1.0.0-beta.3" (so it reads
"`@base-ui-components/react`": "1.0.0-beta.3"), then run your package manager
install to lock the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c5854704-a847-4f28-98d6-f066edc146b8

📥 Commits

Reviewing files that changed from the base of the PR and between bd62672 and 202b4c7.

📒 Files selected for processing (31)
  • apps/ui-layout/components/website/ui/button.tsx
  • apps/ui-layout/package.json
  • packages/shadcn/package.json
  • packages/shadcn/src/base-ui/accordion.tsx
  • packages/shadcn/src/base-ui/aspect-ratio.tsx
  • packages/shadcn/src/base-ui/badge.tsx
  • packages/shadcn/src/base-ui/button.tsx
  • packages/shadcn/src/base-ui/calendar.tsx
  • packages/shadcn/src/base-ui/card.tsx
  • packages/shadcn/src/base-ui/charts.tsx
  • packages/shadcn/src/base-ui/command.tsx
  • packages/shadcn/src/base-ui/dialog.tsx
  • packages/shadcn/src/base-ui/drawer.tsx
  • packages/shadcn/src/base-ui/dropdown.tsx
  • packages/shadcn/src/base-ui/form.tsx
  • packages/shadcn/src/base-ui/hover-card.tsx
  • packages/shadcn/src/base-ui/index.tsx
  • packages/shadcn/src/base-ui/input.tsx
  • packages/shadcn/src/base-ui/label.tsx
  • packages/shadcn/src/base-ui/navigation-menu.tsx
  • packages/shadcn/src/base-ui/plastic-button.tsx
  • packages/shadcn/src/base-ui/popover.tsx
  • packages/shadcn/src/base-ui/scroll-area.tsx
  • packages/shadcn/src/base-ui/slider.tsx
  • packages/shadcn/src/base-ui/switch.tsx
  • packages/shadcn/src/base-ui/tabs.tsx
  • packages/shadcn/src/base-ui/toast.tsx
  • packages/shadcn/src/base-ui/tooltip.tsx
  • packages/shadcn/src/index.tsx
  • packages/shadcn/src/ui/accordion.tsx
  • packages/shadcn/src/ui/index.tsx

Comment on lines +3 to +4
export * from './base-ui/accordion'
export * from './base-ui'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if base-ui/index.tsx re-exports accordion (would cause duplicate)
echo "=== Checking base-ui/index.tsx for accordion re-export ==="
cat packages/shadcn/src/base-ui/index.tsx 2>/dev/null || echo "File not found"

echo ""
echo "=== Checking base-ui modules for pass-through re-exports from ui ==="
# Look at a sample base-ui module to see if it re-exports with same names
rg -n "export.*from.*['\"]\.\.\/ui" packages/shadcn/src/base-ui/ --type tsx --type ts 2>/dev/null || \
rg -n "export.*from.*['\"]\.\.\/ui" packages/shadcn/src/base-ui/

echo ""
echo "=== Checking ui barrel for exported symbols ==="
cat packages/shadcn/src/ui/index.tsx 2>/dev/null | head -30

Repository: ui-layouts/uilayouts

Length of output: 1298


🏁 Script executed:

#!/bin/bash
echo "=== Checking what ui/button exports ==="
cat packages/shadcn/src/ui/button/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what base-ui/button exports ==="
cat packages/shadcn/src/base-ui/button/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what ui/badge exports ==="
cat packages/shadcn/src/ui/badge/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what base-ui/badge exports ==="
cat packages/shadcn/src/base-ui/badge/index.tsx 2>/dev/null || echo "Not found"

Repository: ui-layouts/uilayouts

Length of output: 275


🏁 Script executed:

#!/bin/bash
echo "=== Directory structure of packages/shadcn/src/ ==="
ls -la packages/shadcn/src/

echo ""
echo "=== Content of ui directory ==="
ls packages/shadcn/src/ui/ 2>/dev/null || echo "ui not found"

echo ""
echo "=== Content of base-ui directory ==="
ls packages/shadcn/src/base-ui/ 2>/dev/null | head -20 || echo "base-ui not found"

echo ""
echo "=== Files in ui directory (recursive, limiting to depth 2) ==="
find packages/shadcn/src/ui -maxdepth 2 -type f -name "*.tsx" -o -name "*.ts" 2>/dev/null | head -20

Repository: ui-layouts/uilayouts

Length of output: 1797


🏁 Script executed:

#!/bin/bash
echo "=== ui/button.tsx ==="
cat packages/shadcn/src/ui/button.tsx

echo ""
echo "=== base-ui/button.tsx ==="
cat packages/shadcn/src/base-ui/button.tsx

Repository: ui-layouts/uilayouts

Length of output: 2175


🏁 Script executed:

#!/bin/bash
echo "=== ui/accordion.tsx ==="
cat packages/shadcn/src/ui/accordion.tsx

echo ""
echo "=== base-ui/accordion.tsx ==="
cat packages/shadcn/src/base-ui/accordion.tsx

Repository: ui-layouts/uilayouts

Length of output: 3671


Remove the redundant accordion export and the conflicting base-ui barrel.

Lines 3–4 cause export collisions:

  1. Duplicate accordion export: Line 3 exports BaseUiAccordion from ./base-ui/accordion, and line 4 re-exports it via ./base-ui (which includes export * from './accordion').

  2. Conflicting base-ui re-exports: Base-ui modules re-export identifiers from ui with identical names (e.g., export * from '../ui/button'). Lines 1 and 4 together create duplicate exports of Button, Badge, Tooltip, Command, Popover, and others, preventing bundler compilation.

Remove line 3 and either remove line 4 or line 1, depending on the intended export strategy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shadcn/src/index.tsx` around lines 3 - 4, The top-level exports in
packages/shadcn/src/index.tsx are causing duplicate exports: remove the explicit
accordion re-export and eliminate the conflicting base-ui barrel to avoid
duplicate symbols (e.g., BaseUiAccordion, Button, Badge, Tooltip, Command,
Popover); specifically delete the line exporting './base-ui/accordion' and
remove (or replace) the line exporting './base-ui' so you only export the
intended modules directly (or only export the base-ui barrel), ensuring no
duplicate re-exports of ui/button and other identical identifiers.

Comment on lines +43 to +49
<AccordionPrimitive.Content
ref={ref}
className='overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
{...props}
>
<div className={cn('pb-4 pt-0', className)}>{children}</div>
</AccordionPrimitive.Content>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Apply className to AccordionPrimitive.Content, not the inner wrapper.

Current placement changes consumer-facing styling semantics and blocks overrides on the content root.

Proposed fix
   <AccordionPrimitive.Content
     ref={ref}
-    className='overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
+    className={cn(
+      'overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down',
+      className
+    )}
     {...props}
   >
-    <div className={cn('pb-4 pt-0', className)}>{children}</div>
+    <div className='pb-4 pt-0'>{children}</div>
   </AccordionPrimitive.Content>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shadcn/src/ui/accordion.tsx` around lines 43 - 49, The
consumer-facing className is being applied to the inner wrapper instead of the
content root; change the placement so AccordionPrimitive.Content receives the
merged classes (including 'overflow-hidden text-sm
data-[state=closed]:animate-accordion-up
data-[state=open]:animate-accordion-down' and the incoming className via cn) and
remove className from the inner div that currently wraps children so that
consumers can override the content root; update the component that renders
AccordionPrimitive.Content (keeping ref, {...props}, children) to merge
cn(className, ...) onto AccordionPrimitive.Content instead of the inner <div>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant